package StudyCode.summary.mycollection;

import java.util.ArrayList;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class IfAllElementsInTheInputArrayListAreAllUnique {
	public static boolean isUnique(ArrayList<Integer> arraySet) {
		boolean isUnique = true;
		if (arraySet == null) {
			isUnique = false;
		} else {
			for (int i = 0; i < arraySet.size() && isUnique; i++) {
				for (int j = i + 1; j < arraySet.size() && isUnique; j++) {
					isUnique = arraySet.get(i) != arraySet.get(j);
				}
			}
		}
		return isUnique;
	}
}
